package wyj;


import java.util.Scanner;

public class gps {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        char ch;
        int n=1,m=1;
        String s1;
        s1="";
        String word=in.nextLine();
        while (true){
            if (word.equals("END")){
                break;
            }
            for (int i=7;i<=12;i++){
                ch=word.charAt(i);
                s1=s1+ch;
                int sum=Integer.parseInt(s1);
                if (n==2){
                    if (m==1) {
                        if (sum+8<10){
                            System.out.print("0"+(sum+8));
                        }
                        else if (sum < 16) {
                            System.out.print(sum + 8);
                        }
                        else if (sum==16){
                            System.out.print("00");
                        }
                        else {
                            System.out.print(8-(24 - sum));
                        }
                        m++;
                    }
                    else{
                        System.out.print(":"+sum);
                    }
                    s1="";
                    n=0;
                }
                n++;
            }
            System.out.println();
            word=in.nextLine();
        }
    }
}
